// 该文件专门用于创建整个应用的路由器
import VueRouter from 'vue-router'

import Home from "../views/home/Home.vue";
import Search from "../views/home/Search.vue";
import HomePage from "../views/home/HomePage.vue";
import Mine from "../views/mine/Mine.vue";
import AddressEdit from "../views/mine/AddressEdit.vue";
import UpdateAddressEdit from "../views/mine/UpdateAddressEdit.vue";
import OrderAddress from '../views/mine/OrderAddress.vue'
import MyAddress from "../views/mine/MyAddress.vue";
import Indent from "../views/indent/Indent.vue";
import OrderDetails from "../views/indent/OrderDetails.vue";
import Shop from "../views/shop/Shop.vue";
import ShopType from "../views/shop/ShopType.vue";
import Login from "../views/login/Login.vue";
import UserLogin from "../views/login/UserLogin.vue";
import UserRegister from "../views/login/UserRegister.vue";
import SubmitOrder from '../views/indent/SubmitOrder.vue'
import BusinessRegister from "../views/shopmodule/BusinessRegister.vue";

// 商家门店
import ShopHome from "../views/shopmodule/ShopHome.vue"
import My from "../views/shopmodule/My.vue"
import Nav from "../views/shopmodule/Nav.vue"
import ItemManage from "../views/shopmodule/ItemManage.vue"
import GanagementGroup from "../views/shopmodule/GanagementGroup.vue"
import ManagementGroupNewgroup from "../views/shopmodule/ManagementGroupNewgroup.vue"
import Newgroup from "../views/shopmodule/Newgroup.vue"
import BusinessMy from '../views/shopmodule/BusinessMy.vue'
import BusinessOrder from '../views/shopmodule/BusinessOrder.vue'
import ShopOrderDetails from "../views/shopmodule/OrderDetails.vue";


// 便于二级子路由显示必须引入该组件以支持


export default new VueRouter({
  mode: 'history',
  routes:[
      { // 首页
        path:"/",
        name:"HomePage",
        component:HomePage,
        children:[
          { // 首页
            path:"",
            name:"Home",
            component:Home,
          },
          { // 订单
            path:"/indent",
            name:"Indent",
            component:Indent,
          },
          { // 个人中心
            path:"/mine",
            name:"Mine",
            component:Mine,
          },
        ]
      },
      { // 登录
        path:"/login",
        name:"Login",
        component:Login,
      },
      { // 登录
        path:"/userLogin",
        name:"UserLogin",
        component:UserLogin,
      },
      { // 注册
        path:"/userRegister",
        name:"UserRegister",
        component:UserRegister,
      },
      { // 商家店铺
        path:"/shop/:id",
        name:"Shop",
        component:Shop,
        props:true
      } ,
      { // 搜索
        path:"/search",
        name:"Search",
        component:Search,
      } ,
      { // 提交订单
        path:"/submitOrder/:id",
        name:"SubmitOrder",
        component:SubmitOrder,
        props:true
      } ,
      { // 我的收货地址
        path:"/myAddress",
        name:"MyAddress",
        component:MyAddress,
      } ,
      { // 订单收货地址
        path:"/orderAddress",
        name:"OrderAddress",
        component:OrderAddress,
      } ,
      { // 添加地址
        path:"/addressEdit",
        name:"AddressEdit",
        component:AddressEdit,
      }  ,
      { // 编辑地址
        path:"/updateAddressEdit/:addressId",
        name:"UpdateAddressEdit",
        component:UpdateAddressEdit,
        props:true
      } ,
      { // 订单详情
        path:"/orderDetails",
        name:"OrderDetails",
        component:OrderDetails,
        props:true
      }  ,
      { // 商家类型
        path:"/shopType/:id",
        name:"ShopType",
        component:ShopType,
        props:true
      } ,
      { // 商家入驻
        path:"/businessRegister",
        name:"BusinessRegister",
        component:BusinessRegister,
        props:true
      } ,
      // 商家的门店
      {
          path:"/shopHome",
          name:"nav",
          component:Nav,
          children:[
            { // 门店首页
              path:'/shopHome/:shopid',
              name:"ShopHome",
              component:ShopHome,
              props:true
            },
            { // 门店个人中心
              path:"/BusinessMy",
              name:"BusinessMy",
              component:BusinessMy
            },
            //商家订单
            {
              path:"/businessOrder",
              name:"businessOrder",
              component:BusinessOrder
            }

			  ]
      },
      //商品管理页面
      {
        path:"/item",
        name:"item",
        component:ItemManage,
      },
      //管理分组
      {
          path:"/group",
          name:"group",
          component:GanagementGroup
      },
      //新建分组
      {
          path:"/managementGroupNewgroup",
          name:"managementGroupNewgroup",
          component:ManagementGroupNewgroup
      },
      //商品添加
      {
          path:"/newGroup",
          name:"newgroup",
          component:Newgroup
      },
      { // 商家订单
        path:"/shopOrderDetails/:orderId",
        name:"ShopOrderDetails",
        component:ShopOrderDetails,
        props:true
      } ,
  ]
})


